//
//  WebSocketPositionResult.swift
//  JiaoZiTaxi
//
//  Created by Hu Gang on 2022/10/11.
//

import Foundation

struct WebSocketPositionResult: Codable {
   let cmd: String
   let detectionID, endLat, endLon, endTimestamp: Int
   let laosPoint: LaosPoint
    let mydistance: Double
   let peopleId: String
   let price: Int
   let receiverID: String
   let renshu, sended, shijirenshu, startLat: Int
   let startLon, startTimestamp: Int
   let subCmd: String

   enum CodingKeys: String, CodingKey {
      case cmd
      case detectionID = "detectionId"
      case endLat = "end_lat"
      case endLon = "end_lon"
      case endTimestamp = "end_timestamp"
      case laosPoint = "laos_point"
      case mydistance
      case peopleId
      case price
      case receiverID = "receiverId"
      case renshu, sended, shijirenshu
      case startLat = "start_lat"
      case startLon = "start_lon"
      case startTimestamp = "start_timestamp"
      case subCmd
   }
}

struct LaosPoint: Codable {
   let chepai: String
   let course: String
   let latitude: Double
   let leftTime: Int
   let longitude: Double
   let mydistance: Double
   let mytime: Int
   let name, openid: String
   let pointStatus, time: Int
   let traceCode: String
   let waitEnd, waitStart, waitTime: Int
   let speed: Double
   let price: Int

   enum CodingKeys: String, CodingKey {
      case chepai, latitude
      case course
      case leftTime = "left_time"
      case longitude, mydistance, mytime, name, openid
      case pointStatus = "point_status"
      case time
      case traceCode = "trace_code"
      case waitEnd = "wait_end"
      case waitStart = "wait_start"
      case waitTime = "wait_time"
      case speed
      case price
   }
}
